/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bio.jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Diego
 */
@Embeddable
public class UserHasGroupPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "uid_fk")
    private int uidFk;
    @Basic(optional = false)
    @Column(name = "gid_fk")
    private int gidFk;

    public UserHasGroupPK() {
    }

    public UserHasGroupPK(int uidFk, int gidFk) {
        this.uidFk = uidFk;
        this.gidFk = gidFk;
    }

    public int getUidFk() {
        return uidFk;
    }

    public void setUidFk(int uidFk) {
        this.uidFk = uidFk;
    }

    public int getGidFk() {
        return gidFk;
    }

    public void setGidFk(int gidFk) {
        this.gidFk = gidFk;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) uidFk;
        hash += (int) gidFk;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UserHasGroupPK)) {
            return false;
        }
        UserHasGroupPK other = (UserHasGroupPK) object;
        if (this.uidFk != other.uidFk) {
            return false;
        }
        if (this.gidFk != other.gidFk) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bio.jpa.entities.UserHasGroupPK[ uidFk=" + uidFk + ", gidFk=" + gidFk + " ]";
    }
    
}
